package day04;

import java.util.Scanner;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/18
 */
public class Test02 {
    public static void main(String[] args) {
        int[] arr = {8,4,2,1,23,344,12};
        Bubble.bubble(arr);//调用冒泡算法此时数列已经有序
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字：");
        int a = sc.nextInt();
        int judge=Binary.binarySearch(arr,a );
        if(judge==-1){
            System.out.println("该数列中不包含"+a);
        }
        //else不能省
        else{
            System.out.println("该数列中包含"+a);
        }
    }
}
